home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
itrns211.zip
/
SRC
/
YTABC
< prev
next >
Wrap
Text File
|
1991-12-14
|
31KB
|
1,002 lines
#ifndef lint
static char yysccsid[] = "@(#)yaccpar 1.7 (Berkeley) 09/09/90";
#endif
#define YYBYACC 1
#line 2 "iyacc.y"
/*
*==========================================================================
* Copyright 1991 Avinash Chopde, All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Avinash Chopde not be used in
* advertising or publicity pertaining to distribution of the software
* without specific, written prior permission.
* Avinash Chopde makes no representations about the suitability of this
* software for any purpose.
* It is provided "as is" without express or implied warranty.
*
* AVINASH CHOPDE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
* IN NO EVENT SHALL AVINASH CHOPDE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
* Author: Avinash Chopde, 1991
* C2 Colonial Drive #4, Andover, MA 01810, USA.
*
*/
static char S_RCSID[] = "$Header: e:/itrans/src/rcs/iyacc.y 1.5 91/10/12 21:54:01 avinash Exp $";
#include <stdio.h>
#include "itrans.h"
int G_lineno = 1; /* GLOBAL var: used by lex to indicate current line number */
#define WORD_LEN 511
/* Define a struct to keep track of the components of the letter, and
* the text representation of the word being parsed.
*/
static struct {
char word[WORD_LEN+1];
int curr_letter[WORD_LEN+1]; /* collect tokens regarding this letter here */
int nolig[WORD_LEN+1];/*collect nolig tokens here (see itrans.h, letter_t)*/
int curr_letter_n; /* number of tokens in curr_letter */
int curr_type; /* type of letter - special, vowel, cons, etc */
} S_word;
char G_endprev_str[LINELEN]; /* used by ilex.l to pass string to
* process in case of the ENDPREV_TOK
*/
#define ADD_TOKEN(t) { \
S_word.nolig[S_word.curr_letter_n] = FALSE; \
S_word.curr_letter[S_word.curr_letter_n++] = t; \
strcat(S_word.word, yytext); \
}
#define ADD_TOKEN_TYPE(t, typ) { \
ADD_TOKEN(t); \
S_word.curr_type = typ; \
}
/* forward declarations (for prototypes) */
static void S_init_command();
static void S_end_command();
static void S_init_word();
static void S_end_word();
static void S_end_letter();
static void S_init_letter();
static void S_handle_other(char*);
#line 80 "y_tab.c"
#define DUMMY_TOK 257
#define A_TOK 258
#define AA_TOK 259
#define I_TOK 260
#define II_TOK 261
#define U_TOK 262
#define UU_TOK 263
#define RI_TOK 264
#define RII_TOK 265
#define LI_TOK 266
#define LII_TOK 267
#define AY_TOK 268
#define AAY_TOK 269
#define AI_TOK 270
#define O_TOK 271
#define OO_TOK 272
#define AU_TOK 273
#define AM_TOK 274
#define AHA_TOK 275
#define KA_TOK 276
#define KHA_TOK 277
#define GA_TOK 278
#define GHA_TOK 279
#define NGA_TOK 280
#define CHA_TOK 281
#define CHHA_TOK 282
#define JA_TOK 283
#define JHA_TOK 284
#define JNH_TOK 285
#define TTA_TOK 286
#define TTHA_TOK 287
#define DDA_TOK 288
#define DDHA_TOK 289
#define NNA_TOK 290
#define TA_TOK 291
#define THA_TOK 292
#define DA_TOK 293
#define DHA_TOK 294
#define NA_TOK 295
#define PA_TOK 296
#define PHA_TOK 297
#define BA_TOK 298
#define BHA_TOK 299
#define MA_TOK 300
#define YA_TOK 301
#define RA_TOK 302
#define LA_TOK 303
#define VA_TOK 304
#define SHA_TOK 305
#define SHHA_TOK 306
#define SA_TOK 307
#define HA_TOK 308
#define LDA_TOK 309
#define KSHA_TOK 310
#define GYA_TOK 311
#define NNX_TOK 312
#define NYA_TOK 313
#define RRA_TOK 314
#define KADOT_TOK 315
#define KHADOT_TOK 316
#define GADOT_TOK 317
#define DDADOT_TOK 318
#define DDHADOT_TOK 319
#define JADOT_TOK 320
#define PHADOT_TOK 321
#define RA_HALF_TOK 322
#define ANUSVARA_TOK 323
#define CHANDRA_TOK 324
#define CHANDRA_BN_TOK 325
#define VIRAAM_TOK 326
#define AVAGRAHA_TOK 327
#define SRI_TOK 328
#define AUM_TOK 329
#define BLANK_TOK 330
#define NEWLINE_TOK 331
#define NOLIG_TOK 332
#define COMMAND_TOK 333
#define ENDPREV_TOK 334
#define ILANG_TOK 335
#define MARATHI_TOK 336
#define HINDI_TOK 337
#define TAMIL_TOK 338
#define BENGALI_TOK 339
#define TELUGU_TOK 340
#define MALAYALAM_TOK 341
#define GUJARATI_TOK 342
#define ORIYA_TOK 343
#define KANNADA_TOK 344
#define SANSKRIT_TOK 345
#define ENDLANG_TOK 346
#define SETIFM_TOK 347
#define SETFONT_TOK 348
#define YYERRCODE 256
short yylhs[] = { -1,
0, 0, 0, 3, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 2, 5, 2, 7,
2, 2, 2, 2, 4, 4, 4, 9, 9, 10,
10, 10, 13, 13, 13, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 11,
11, 11, 11, 11, 11, 11, 11, 6, 8, 8,
15, 15,
};
short yylen[] = { 2,
0, 2, 2, 0, 5, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 0, 0, 3, 0,
3, 2, 2, 1, 1, 2, 2, 1, 1, 1,
2, 1, 1, 2, 2, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
1, 1,
};
short yydefred[] = { 1,
0, 8, 6, 7, 9, 11, 12, 13, 14, 15,
16, 10, 2, 3, 4, 0, 24, 0, 111, 112,
23, 5, 0, 0, 0, 109, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 98, 99, 96, 97,
100, 101, 103, 104, 102, 105, 106, 107, 0, 25,
28, 29, 30, 0, 33, 108, 21, 110, 27, 26,
35, 31, 34,
};
short yydgoto[] = { 1,
15, 18, 16, 99, 23, 107, 24, 25, 100, 101,
102, 103, 104, 105, 26,
};
short yysindex[] = { 0,
175, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, -182, 0, 161, 0, 0,
0, 0, 148, -254, -253, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, -80, 0,
0, 0, 0, 73, 0, 0, 0, 0, 0, 0,
0, 0, 0,
};
sho